<?php
include_once 'boot.php';
include_once 'employees_fields.php';

$ar_data = get_array_query_full("SELECT * FROM employees");

$mode = $_GET['mode'];
//echo "<pre>";
if($mode == 'all'){

//print_r($ar_data);

$tcsv = new CF_TableCsv('all',$ar_data,'testtable');



//print_r($tcsv->fieldspec);
$thetext = $tcsv->maketable();
//print $thetext;
$tcsv->export_to_csv('testcsv.csv', true);
}else {

$tcsv = new CF_TableCsv($employees_spec,$ar_data,'testtable');
$tcsv->export_to_csv('testcsv.csv', false);

}


//echo "<pre/>";
?>